import 'package:flutter/material.dart';
import 'package:flutter_09_game/base/controller/base_controller.dart';
import 'package:flutter_09_game/config/app_color.dart';
import 'package:flutter_09_game/config/app_routes.dart';
import 'package:flutter_09_game/generated/assets.dart';
import 'package:flutter_09_game/generated/locales.g.dart';
import 'package:flutter_09_game/user/app_user_manager.dart';
import 'package:flutter_09_game/widgets/button/common_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

class ProfileSafetyCenterLogic extends BaseController {
  


  @override
  void onInit() {
    super.onInit();
    _updateSafetyItemsStatus();
  }

  // 更新安全项目状态
  void _updateSafetyItemsStatus() {
    // 这里可以根据实际业务逻辑更新绑定状态
    // 例如从服务器获取用户的安全设置状态
  }

  // 处理安全项目点击
  void onSafetyItemTap(int index) {
    // if (index < safetyItems.length) {
    //   final item = safetyItems[index];
    //   Get.toNamed(item.route);
    // }
  }

  // 处理退出登录
  void onLogoutTap() {
    // Get.dialog(
    //   AlertDialog(
    //     backgroundColor: AppColor.safetyCardBackground,
    //     shape: RoundedRectangleBorder(
    //       borderRadius: BorderRadius.circular(12.w),
    //     ),
    //     title: Text(
    //       LocaleKeys.logoutConfirmTitle.tr,
    //       style: TextStyle(
    //         color: AppColor.safetyTextPrimary,
    //         fontSize: 16.sp,
    //         fontWeight: FontWeight.w600,
    //       ),
    //     ),
    //     content: Text(
    //       LocaleKeys.logoutConfirmMessage.tr,
    //       style: TextStyle(
    //         color: AppColor.safetyTextSecondary,
    //         fontSize: 14.sp,
    //         fontWeight: FontWeight.w400,
    //       ),
    //     ),
    //     actions: [
    //       CommonButton(
    //         title: LocaleKeys.cancel.tr,
    //         width: 80.w,
    //         height: 36.w,
    //         backgroundColors: [AppColor.safetyTextSecondary],
    //         textColor: AppColor.safetyTextPrimary,
    //         onClick: () => Get.back(),
    //       ),
    //       8.horizontalSpace,
    //       CommonButton(
    //         title: LocaleKeys.confirm.tr,
    //         width: 80.w,
    //         height: 36.w,
    //         backgroundColors: [AppColor.safetyLogoutText],
    //         textColor: Colors.white,
    //         onClick: () {
    //           Get.back(); // 关闭对话框
    //           _performLogout();
    //         },
    //       ),
    //     ],
    //   ),
    //   barrierDismissible: true,
    // );
  }


}


